package cn.appsys.controller.devuser;

import javax.servlet.http.HttpSession; 

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import cn.appsys.pojo.AppInfo;
import cn.appsys.tools.Constants;

@Controller
@RequestMapping(value = "/dev")
public class DevUserController {

	/**
	 * 登陆成功跳转主界面
	 */
	@RequestMapping("/devmain")
	public String main(HttpSession session){
		if(session.getAttribute(Constants.DEV_USER_SESSION)!=null){
			return  "dev/NewFile";
		}
		return "redirect:/devUserLogin.html";
	}
	/**
	 * 退出登陆
	 */
	@RequestMapping("/devlogout")
	public String outLogin(HttpSession session) {
		session.removeAttribute(Constants.DEV_USER_SESSION);
		return "redirect:/devUserLogin.html";
	}
	/**
	 * 跳转App维护jsp
	 * */
	@RequestMapping(value="/appweihu")
	public String appweihu() {
		return "dev/appinfolist";
	}
	
	/**
	 * 跳转add页面
	 * */
	@RequestMapping(value="/appinfoadd",method=RequestMethod.GET)
	public String appinfoadd(@ModelAttribute("appInfo")AppInfo appInfo) {
		return "dev/appinfoadd";
	}
}
